#统计文件中某字符串的个数
with open("D:/书/test.txt","r",encoding= "UTF-8") as f:
    content = f.read()#读取全部内容
    count = content.count("，")#字符串出现次数统计
    print(f"文件中逗号的个数是：{count}")
print("-------------------")
num = 0
with open("D:/书/test.txt","r",encoding= "UTF-8") as f:
    for line in f:#遍历文件中每一行句子
        words = line.strip().split("，")#strip去除首尾空格以及换行符,逗号分割后生成列表
        print(words)
        for word in words:
            num += word.count("大")#计算字符数量，累加到num中

print(num)